; kernel code segment selector
SEL_KERN_CODE   EQU 0x8
; kernel data segment selector
SEL_KERN_DATA   EQU 0x10

[bits 32]
[section .text]

global gdt_flush
extern gp

gdt_flush:
	lgdt [gp]
	mov ax,SEL_KERN_DATA
	mov ds,ax
	mov es,ax
	mov fs,ax
	mov gs,ax
	mov ss,ax
	jmp SEL_KERN_CODE:flush2
flush2:
	ret

global load_idt
extern idt_ptr

load_idt:
	lidt [idt_ptr]
	ret
